-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
geolocation button closes issue#780 #800
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add the locate
API method and associated events, to <mapml-viewer>
and <map is=web-map>
The control has 3 states: off (black) tracking (orange) and last known location (blue). These visual states need to be available to screen readers, so that when the focus lands on the control, it reads out "Show my location control - location tracking mode" (for example). "Show my location - last known location mode" and "Show my location - location off". We need to figure out how to convey the semantics of features' positions relative to your location, if shown, to screen reader users. I am thinking the as-the-crow-flies distance might be a good start. We don't have to to this last idea in this PR, but we definitely need to convey the location button states per my first comment. |
@Jacky0299 you're working on this, is that correct?
|
yes |
@Jacky0299 L.Control.Locate is ending up in dist folder. It should be bundled via rollup with in leaflet.js. Checkout how the other controls manage this, use them as example of how-to. |
@Jacky0299 is there any way to instead of the screen reader saying "Button" when you focus your location on the map, to have it say "Your (last known) / (current) location shown on the map", where "last known" or "curren" is said based on the tracking mode of the control? Since we've got it as a tab stop, we need to be more informative about what it is besides just "Button". |
src/mapml-viewer.js
Outdated
@@ -704,6 +704,9 @@ export class MapViewer extends HTMLElement { | |||
} | |||
locate(options){ | |||
if (this._map) { | |||
if (this._geolocationButton) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jacky0299 Please add a test for the location API bug Fix. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work Jacky! Looks good to me LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @Jacky0299, great work!
closes #780